import type { LoginResult } from "@/types/member"
import { http } from "@/utils/https"
type LoginParams = {
  code: string,
  encryptedData: string,
  iv: string
}
type loginByUserName = { username: string, password: string }

/**
 * 小程序登录的接口
 * @param data 数据
 * @returns
 */
export const loginByUserName = (data: loginByUserName) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/auth/login',
    data,
  })
}
/**
 * 模拟登录
 * @param phoneNumber 模拟手机号码
 * @returns
*/
export const postLoginWxMinSimpleAPI = (phoneNumber: string) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/login/wxMin/simple',
    data: {
      phoneNumber
    }
  })
}
